package mmq.mina.codec;

import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFactory;
import org.apache.mina.filter.codec.ProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolEncoder;

public class ProtobufCodecFactory implements ProtocolCodecFactory {

	private final ProtocolEncoder encoder;
	private final ProtocolDecoder decoder;

	public ProtobufCodecFactory(ProtocolEncoder encoder, ProtocolDecoder decoder) {
		this.encoder = encoder;
		this.decoder = decoder;
	}	
	
	public ProtocolEncoder getEncoder(IoSession session) throws Exception {
		return encoder;
	}	
	
	public ProtocolDecoder getDecoder(IoSession session) throws Exception {
		return decoder;
	}
	
}
